/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */
package cn.itcast;

import org.jsoup.Jsoup;

import javax.swing.*;
import java.io.IOException;

/**
 * <p>Project: JavaStudy - Dict
 * <p>Powered by jiangbo On 2023-02-18
 * 16:41:29
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class Dict {
    public static void main(String[] args) throws IOException {
        String w = "美国";
//        微软词典
        w = JOptionPane.showInputDialog("请输入词汇：");
        String u = "https://cn.bing.com/dict/search?q=" + w;
        String ok = Jsoup.connect(u).get().select("span[class=def b_regtxt]").get(0).text();
        //System.out.println(ok);
        JOptionPane.showMessageDialog(null,ok);
    }
}


